feat(contracts): reproducible WASM builds with hash verification in CI - #1386
Merged
Calebux merged 1 commit intoSep 1, 2026
Merged
Conversation
- Add contracts/rust-toolchain.toml pinning Rust 1.81.0 (required by
soroban-sdk v27) with wasm32-unknown-unknown target and minimal profile
- Rewrite .github/workflows/contracts.yml:
- Build with --locked on every cargo invocation (Cargo.lock is
authoritative)
- Double-build determinism check: build twice, wipe WASM output between
passes, fail if any sha256 differs
- Emit per-contract sha256 hashes to the GitHub Actions job summary as
a Markdown table
- Upload wasm-contracts-<sha> and wasm-hashes-<sha> artifacts (90-day
retention) on every contract PR and push to main
- Add publish-manifest job (tags only): generates and commits
contracts/build-manifest.json with version, commit, toolchain, and
per-contract sha256
- Fix two pre-existing shell bugs in the contract-size check step
- Add contracts/build-manifest.json placeholder (populated by CI on
tagged releases)
- Add contracts/scripts/build-reproducible.sh: single documented command
for guardians to reproduce hashes locally and compare against the
published manifest
Closes Calebux#1228
|
@cyberdocs120 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements #1228 — guardians can now independently verify that deployed WASM matches source.
Changes
contracts/rust-toolchain.toml(new)Pins Rust
1.81.0withwasm32-unknown-unknowntarget. Required by soroban-sdk v27 (confirmed from Cargo.lock). Rustup picks this up automatically in any subdirectory ofcontracts/..github/workflows/contracts.yml(rewritten)cargo build/cargo testcalls now use--locked(Cargo.lock is authoritative)wasm-contracts-<sha>andwasm-hashes-<sha>artifacts (90-day retention)publish-manifestjob (tags only): generates and commitscontracts/build-manifest.jsoncontracts/build-manifest.json(new placeholder)Populated by CI on tagged releases. Maps each contract to sha256, commit, toolchain, and release tag.
contracts/scripts/build-reproducible.sh(new)Single documented command for guardians:
bash
bash contracts/scripts/build-reproducible.sh # current tree
bash contracts/scripts/build-reproducible.sh v1.2.3 # specific tag
Auto-compares produced hashes against
build-manifest.jsonwhenjqis available.Acceptance criteria
rust-toolchain.tomlpins the exact toolchain used for release buildsCloses #1228